package com.ihr360.cnb.module.insurance.service.feign;

import com.ihr360.cnb.module.insurance.service.feign.fallback.InsuranceCompanyBenefitServiceFallback;
import com.ihr360.commons.model.type.BenefitCategory;
import com.ihr360.commons.vo.PageData;
import com.ihr360.insurance.entity.request.SingleStaffBenefitVoRequest;
import com.ihr360.insurance.entity.request.StaffBenefitRequest;
import com.ihr360.insurance.entity.request.StaffBenefitVoRequest;
import com.ihr360.insurance.entity.request.StaffIdRequest;
import com.ihr360.insurance.entity.vo.StaffBenefitVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Stone.Shi
 * @description 社保公积金方案feign service
 * @date 2018-06-06 15:23:41.
 */
@FeignClient(name = "ihr360-insurance-provider", fallback = InsuranceCompanyBenefitServiceFallback.class)
public interface InsuranceCompanyBenefitService {

    /**
     * 按条件获取还未关联社保公积金的员工数据
     *
     * @param companyId
     * @param staffBenefitRequest
     * @return
     */
    @PostMapping(value = "/companyBenefits/getUnrelatedList/", produces = MediaType.APPLICATION_JSON_VALUE)
    PageData<StaffBenefitVo> getUnrelatedStaffs(@RequestParam(value = "companyId") String companyId,
                                                @RequestBody StaffBenefitRequest staffBenefitRequest);

    /**
     * 获取公司已关联社保/公积金方案总人数
     *
     * @param companyId
     * @param category       SI/HF
     * @param staffIdRequest
     * @return
     */
    @PostMapping(value = "/companyBenefits/staff/count/related/", produces = MediaType.APPLICATION_JSON_VALUE)
    int getRelatedStaffCount(@RequestParam(value = "companyId") String companyId,
                             @RequestParam(value = "category") BenefitCategory category,
                             @RequestBody StaffIdRequest staffIdRequest);

    /**
     * 获取公司未关联社保/公积金方案总人数 在职
     *
     * @param companyId
     * @param category       SI/HF
     * @param staffIdRequest
     * @return
     */
    @PostMapping(value = "/companyBenefits/staff/count/unRelated/", produces = MediaType.APPLICATION_JSON_VALUE)
    int getUnRelatedStaffCount(@RequestParam(value = "companyId") String companyId,
                               @RequestParam(value = "category") BenefitCategory category,
                               @RequestBody StaffIdRequest staffIdRequest);

    /**
     * 社保公积金方案、员工社保公积金档案中保存数据
     *
     * @param companyId
     * @param category
     * @param request
     */
    @PostMapping(value = "/companyBenefits/staff/save/", produces = MediaType.APPLICATION_JSON_VALUE)
    void saveBenefits(@RequestParam(value = "companyId") String companyId,
                      @RequestParam(value = "category") BenefitCategory category,
                      @RequestBody StaffBenefitVoRequest request);

    /**
     * @param companyId
     * @param category
     * @param request
     */
    @PostMapping(value = "/companyBenefits/staff/saveSiOrHf/", produces = MediaType.APPLICATION_JSON_VALUE)
    void saveSingleBenefits(@RequestParam(value = "companyId") String companyId,
                            @RequestParam(value = "category") BenefitCategory category,
                            @RequestBody SingleStaffBenefitVoRequest request);

    /**
     * @param companyId
     * @param category
     * @param request
     */
    @PostMapping(value = "/companyBenefits/staff/deleteSiOrHf/", produces = MediaType.APPLICATION_JSON_VALUE)
    void deleteSingleBenefits(@RequestParam(value = "companyId") String companyId,
                              @RequestParam(value = "category") BenefitCategory category,
                              @RequestBody SingleStaffBenefitVoRequest request);
}
